﻿using DevExpress.Skins;
using DevExpress.UserSkins;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;

namespace FuelDXApplication1
{
    internal static class Program
    {

        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }

        #region
        //private static FileSystemWatcher s_watcher;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        //[STAThread]
        //static void Main()
        //{
        //    监视当前目录下所有的txt文件
        //    WatchFiles(".", "*.txt");
        //    Application.EnableVisualStyles();
        //    Application.SetCompatibleTextRenderingDefault(false);
        //    Application.Run(new Form1());
        //}

        //public static void WatchFiles(string path, string filter)
        //{
        //    s_watcher = new FileSystemWatcher(path, filter)
        //    {
        //        IncludeSubdirectories = true
        //    };
        //    s_watcher.Created += OnFileChanged;
        //    s_watcher.Changed += OnFileChanged;
        //    s_watcher.Deleted += OnFileChanged;
        //    s_watcher.Renamed += OnFileRenamed;
        //    s_watcher.EnableRaisingEvents = true;
        //    Console.WriteLine("watching file changes...");
        //}

        //public static void UnWatchFiles()
        //{
        //    s_watcher.Created -= OnFileChanged;
        //    s_watcher.Changed -= OnFileChanged;
        //    s_watcher.Deleted -= OnFileChanged;
        //    s_watcher.Renamed -= OnFileRenamed;
        //    s_watcher.Dispose();
        //    s_watcher = null;
        //}

        //private static void OnFileRenamed(object sender, RenamedEventArgs e) =>
        //    Console.WriteLine($"file {e.OldName} {e.ChangeType} to {e.Name}");

        //private static void OnFileChanged(object sender, FileSystemEventArgs e) =>
        //    Console.WriteLine($"file {e.Name} {e.ChangeType}");
        #endregion

    }
}
